<%
'------------------------------------------------------------------------------------------------------------------------
'Get the PAYE ref number for the business unit
public function GetBusinessUnitPAYERefNumber()
	dim sReturnValue
	
	'LCB users to not have the ref number auto-populated, as requested by Lesley.
	if len(Session("nComID")) > 0 and len(Session("sBuniCode")) > 0 and Session("sBuniCode") <> "LCB" then
		dim objBusinessUnits, objFunctions
		
		on error resume next
		
		set objBusinessUnits = Server.CreateObject("KeyTax.clsBusinessUnits")
		set objFunctions = Server.CreateObject("KeyTax.clsFunctions")
		
		if err.number = 0 then
			sReturnValue = objBusinessUnits.GetPAYERefNumber(Session("nComID"), Session("sBuniCode"))
		end if
		
		set objBusinessUnits = nothing
		set objFunctions = nothing
	end if	
	
	GetBusinessUnitPAYERefNumber = sReturnValue
end function
'------------------------------------------------------------------------------------------------------------------------
%>